package com.dyrj.pig.controller;

import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.RequestMapping;
import com.dyrj.vo.PageResultMsg;
import com.dyrj.vo.ResultMsg;
import com.dyrj.pig.service.ITJzbYhmcService;
import com.dyrj.pig.bean.TJzbYhmc;
import java.util.List;

import org.springframework.stereotype.Controller;

/**
 * <p>
 * 见证宝--支持银联验证的银行列表 前端控制器
 * </p>
 *
 * @author admin
 * @since 2020-10-18
 */
@Controller
@RequestMapping("/pig/t-jzb-yhmc")
public class TJzbYhmcController {

    @Resource
    private ITJzbYhmcService service;

    @GetMapping("/index")
    @RequiresPermissions("pig:t-jzb-yhmc:index")
    public String index(ModelMap map) {
    return "pig/index_t-jzb-yhmc";
    }

    /**
    * @Title: table
    * @Description: (表格数据) 列表
    * @return PageInfo<TJzbYhmc>    返回类型
    */
    @GetMapping("/table")
    @ResponseBody
    @RequiresPermissions("pig:t-jzb-yhmc:index")
    public PageResultMsg table(TJzbYhmc record) {
        return service.table(record);
    }

    /**
    * @Title: add
    * @Description: (新增)
    * @param record
    * @return ResultMsg    返回类型
    */
    @PostMapping("/")
    @ResponseBody
    @RequiresPermissions("pig:t-jzb-yhmc:add")
    public ResultMsg add(TJzbYhmc record) {
        return service.add(record);
    }

    /**
    * @Title: info
    * @Description: (详情)
    * @param id
    * @return TJzbYhmc    返回类型
    */
    @GetMapping("/{id}")
    @ResponseBody
    @RequiresPermissions("pig:t-jzb-yhmc:info")
    public TJzbYhmc info(@PathVariable String id) {
        return service.info(id);
    }

    /**
    * @Title: update
    * @Description: (更新)
    * @param record
    * @return ResultMsg    返回类型
    */
    @PutMapping("/")
    @ResponseBody
    @RequiresPermissions("pig:t-jzb-yhmc:edit")
    public ResultMsg update(TJzbYhmc record) {
        return service.update(record);
    }

    /**
    * @Title: delete
    * @Description: (删除)
    * @param id
    * @return ResultMsg    返回类型
    */
    @DeleteMapping("/{id}")
    @ResponseBody
    @RequiresPermissions("pig:t-jzb-yhmc:delete")
    public ResultMsg delete(@PathVariable String id) {
        return service.delete(id);
    }


    /**
     * @Description: 模糊搜索银行名称列表
     * @return PageInfo<TJzbYhmc>    返回类型
     */
    @GetMapping("/getyhmclist")
    @ResponseBody
    public ResultMsg getYhmcList(TJzbYhmc record) {
        return service.selectYhmc(record);
    }

}
